package com.example.outofschool;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class MyViewModel extends ViewModel {
    private String userName;
    private String userId;
    private String userAcademy;
    private String crxType;
    private String location;

    private MutableLiveData<String> liveNumber;
    private MyRepository myRepository;

    public MutableLiveData<String> getLiveNumber() {
        if (liveNumber == null) {
            liveNumber = new MutableLiveData<String>();
        }
        return liveNumber;
    }

    public void setNumber(){
        if (myRepository == null) {
            myRepository = new MyRepository(liveNumber);
        }
        myRepository.getNumber(getCrxType(),getLocation());
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getCrxType() {
        return crxType;
    }

    public void setCrxType(String crxType) {
        this.crxType = crxType;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserAcademy() {
        return userAcademy;
    }

    public void setUserAcademy(String userAcademy) {
        this.userAcademy = userAcademy;
    }
}